package org.eirudy.shareimage.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.eirudy.shareimage.model.dto.user.UserQueryRequest;
import org.eirudy.shareimage.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import org.eirudy.shareimage.model.vo.LoginUserVO;
import org.eirudy.shareimage.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author Eirudy
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-05-07 08:47:25
*/
public interface UserService extends IService<User> {

    /**
     *  用户注册，其实这里应该封一个request的，现在太复杂了
     * @param userAccount
     * @param userPassword
     * @param checkPassword
     * @return
     */
    long userRegister(String userAccount,String userPassword,String checkPassword);

    /**
     *  获得加密后的密码
     * @param password
     * @return
     */
    String getEncryptPassword(String password);

    /**
     *  用户登录
     * @param userAccount
     * @param password
     * @param request
     * @return
     */
    LoginUserVO userLogin(String userAccount, String password, HttpServletRequest request);

    /**
     *  ObjToVo  这个和UserVo的不同点是？
     * @param user
     * @return
     */
    LoginUserVO getLoginUserVO(User user);

    /**
     * 获得脱敏后的User
     * @param user
     * @return
     */
    UserVO getUserVO(User user);

    List<UserVO> getUserVOList(List<User> users);

    User getLoginUser(HttpServletRequest request);

    /**
     * 用户退出
     * @param request
     * @return
     */
    boolean userLogout(HttpServletRequest request);

    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    boolean isAdmin(User user);
}
